chapter three, we'll look at the benefits of this design when we discuss Git branch management.Nearly all operations are performed locallyThe vast majority of operations in Git require access to local files and resources without a network connection. But if you use CVCS, almost all operations need to be connected to the network. Because Git keeps a historical up
notes and other information, very comprehensiveFirst come here, unconsciously 4 o'clock in the morning, about the use of tortoisegit will make you constantly pleasantly surprised, the next chapter will continue to introduce the establishment of branches, flexible switching between branches, merging and so very useful functions.8. Highlights of this section:The content of this section is more, first let us to git this version of the control system has
Transferred from: http://www.cnblogs.com/sunada2005/archive/2013/06/06/3121098.htmlIt feels good to be using GitHub recently. Under Windows, you can use the Windows Client (http://windows.github.com/) provided by GitHub. Very stupid, very convenient. How do I use it? See: Http://www.cr173.com/html/15618_1.html. It has recently been discovered that when installing GitHub's Windows client on a corporate computer, it is possible that the company's networ
tar xjv -C /usr/local/share/man -f git-manpages-1.7.2.1.tar.bz2You can also copy and execute the following script to easily fix the manual installation:cd /tmpcurl -O "http://kernel.org/pub/software/scm/git/git-manpages-`git --version | awk ‘{print $3}‘`.tar.bz2"sudo mkdir -p /usr/local/share/mansudo tar xjv -C /usr/l
When we need to delete 暂存区 or 分支 on the file, and the workspace also does not need this file, you can useWhen we need to delete 暂存区 or 分支 file on, but local need to use, just do not want this file to be version controlled, can usegit rm --cached file_path
File_path to file path
Yin FengLinks: Https://www.jianshu.com/p/337aeafc2f40Source: PinterestCopyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the sour
content? We can go back with the version number and use the command method as follows:Git reset--hard version number, but now if I've turned off the command line or the version number of the 333 content, I don't know. How do you know the version number that adds 3333 content? The version number can be obtained from the following command: The Git reflog demo is as follows:As we can see from the above displa
–pretty=oneline demo is as follows:Now I want to use the version fallback operation, I want to fallback the current version to the previous version, what command to use? You can use the following 2 kinds of commands, the first is: Git reset–hard head^ Then if you want to fall back to the first version just change head^ to head^^ and so on. If you want to fall back to the first 100 versions, using the above method is certainly inconvenient, we can use
? We can go back with the version number and use the command method as follows:Git reset--hard version number, but now if I've turned off the command line or the version number of the 333 content, I don't know. How do you know the version number that adds 3333 content? The version number can be obtained from the following command: The Git reflog demo is as follows:As we can see from the above display, the v
staging area, including subdirectories $ git add[dir]# Add all files of the current directory to staging area $ git add . # Delete the workspace file and put this deletion into staging area $ git rm [file1] [file2] . . # Stop tracking the specified file, but the file will remain in the workspace $ git rm --cached [Fi
]:[BRANCH_NAME_REMOTE] $ git pullExample:$ git remote add binRepo https://coding.net/chenbin/GitTest2.git $ git push binbin binRepo:master //由于是第一次推送,该操作已经使得分支binbin 跟踪了远程分支 binRepo/mastrWhen a branch a tracks remote Branch B, that is, B becomes the default pull source for a, and therefor
useless for our project, we can exclude it, and some text editor will use the ~ end of the backup file, but also to exclude:
. ds_store*~
This rule is described in more detail in section 2.2 of Pro Git.Then we can add the document, if you follow the above to set the Ignore rule, you can simply execute:$ git Add.This will add all the files except the Ignore rule, or you can:$ git
default behaviour, setRemote:error: ' receive.denycurrentbranch ' configuration variable to ' refuse '.to [email protected]:/opt/git/project.git/! [Remote rejected] master, master (branch is currently checked out)Error:failed to push some refs to ' [email protected]:/opt/git/project.git/'A:$cd. Git$vim ConfigThe original contents of the configuration file are:[C
current branchA. Git patcha). Git format-patch-1 hit a patch that is currently being submitted, which is the last commit changeb). Git fromat-patch-1 6525c43add803bfee37cf5c1cb573ed8aecf529e hit a patch that specifies a specific timec). Git format-patch-2 6525c43add803bfee37cf5c1cb573ed8aecf529e based on a two-time pa
a version control system is in the package Git-core.?
12
$sudoaptitudeinstallgit-core$sudo aptitudeinstallgit-docgit-svngit-emailgit-guigitk
--rhel,fedora,centos:?
12
$yuminstallgit$yuminstallgit-docgit-svngit-emailgit-guigitk
The process of installing git in other distributions is similar to the method described above. The
the result of your most recent commit.After three steps above, your changes are now in the HEAD of the local repository, but the source code is not saved (pushed) to the remote repository, you can execute the following command to commit the changes to the remote repository: git push origin master,(master表示你要提交的分支, You can put the master Switch to any branch you want to push)How to use:1 initialization, creation of the project;1) using local or local
BranchesGit branch-r# Start Tracking One remote branchGit branch--track some_branch origin/some_branch# Change to the branch locallygit checkout Some_branch# make changes and commit them locally....# Push your changes to the remote repository:git pushTo create a remote branch# Create a new branch locallyGit branch Name_of_branchgit checkout Name_of_branch# edit/add/remove Files # Commit your changes locallygit add fileNameGit commit-m Message# Push changes and new branch to remote repository
must be committed locally, and finally committed to the remote repository2. See who submitted the code, right-click on "Team"-"Show History"3. View commit record: Team--show in history (command behavior: git log)4. Undo recovery changes: Replace with--head Revision (command behavior git checkout HEAD.)5. Update Project remote repository: team--Pull (command line: Git
1th usage (including Next, let's take a look at usage 2, in the first part, we know that switching branches will change the head direction, so what happens if we check out a commit? As with the checkout branch, the contents of the current branch workspace and staging area are overwritten with the contents of the commit, see example.Currently we are on the master branch, and we have two commits, C1 and C2, and then we modify a, add the content "C3" to the a file, and add to staging area, then us
(through mouse operation), or, if you're not familiar with Git's core view, more right-click The option is equivalent to a piece of white paper, so you don't know how to do it. But if you really know what Git is made of and what it is, using Sourcetree is definitely going to be more than enough!The following is the Sourcetree installation process:
Connect to http://www.sourcetreeapp.com/to download the installation files first.
After downloadin
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.